function[kp] = ap2kp1(ap_index),
switch ap_index
    case 0, kp = 0; 
    case 2, kp = 0.33; 
    case 3, kp = 0.67; 
    case 4, kp = 1.0; 
    case 5, kp = 1.33; 
    case 6, kp = 1.67; 
    case 7, kp = 2.0; 
    case 9, kp = 2.33; 
    case 12, kp = 2.67; 
    case 15, kp = 3.0; 
    case 18, kp = 3.33; 
    case 22, kp = 3.67; 
    case 27, kp = 4.0; 
    case 32, kp = 4.33; 
    case 39, kp = 4.67; 
    case 48, kp = 5.0; 
    case 56, kp = 5.33; 
    case 67, kp = 5.67; 
    case 80, kp = 6.0; 
    case 94, kp = 6.33; 
    case 111, kp = 6.67; 
    case 132, kp = 7.0; 
    case 154, kp = 7.33; 
    case 179, kp = 7.67; 
    case 207, kp = 8.0; 
    case 236, kp = 8.33; 
    case 300, kp = 8.67; 
    case 400, kp = 9.0; 
    otherwise, fprintf('error in ap value: ap = %d \n',ap_index);  
end;